package com.example.alladapter.utils;

import android.content.Context;
import android.widget.ImageView;

import com.example.alladapter.R;

import java.util.Random;

public class changebackground {
    private int pics[] = {R.mipmap.pic1, R.mipmap.pic2, R.mipmap.pic3,
            R.mipmap.pic4, R.mipmap.pic5, R.mipmap.pic6, R.mipmap.pic7, R.mipmap.pic8};
    private Context mContext;
    private ImageView imageView;

    public changebackground(Context context, ImageView imageView) {
        mContext = context;
        this.imageView = imageView;
    }

    public changebackground(ImageView imageView) {
        this.imageView = imageView;
    }

    public void startChange() {
        int s[] = new int[10];
        Random random = new Random();
        for (int j = 0; j < 10; j++) {
            s[j] = random.nextInt(33);
        }
        int k = random.nextInt(10);
        imageView.setImageResource(pics[s[k] % 8]);
    }

}
